//+------------------------------------------------------------------+ //| #Parabolic 2TF.mq4 | //| cja | //+------------------------------------------------------------------+ #property copyright "Kalenzo - code adapted to bars by cja" #property link "http://www.foreksik.prv.pl" #property indicator_separate_window #property indicator_minimum 0 #property indicator_maximum 3 #property indicator_buffers 4 #property indicator_color1 RoyalBlue #property indicator_color2 RoyalBlue #property indicator_color3 OrangeRed #property indicator_color4 OrangeRed //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; extern int Maxbars = 1500; extern double Step = 0.013; extern double Maximum = 0.20; extern int Precision = 5; extern int TF1 = PERIOD_M15; extern int TF2 = PERIOD_M5; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,110); SetIndexBuffer(0,ExtMapBuffer1); SetIndexEmptyValue(0,0.0); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,110); SetIndexBuffer(1,ExtMapBuffer2); SetIndexEmptyValue(1,0.0); SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,110); SetIndexBuffer(2,ExtMapBuffer3); SetIndexEmptyValue(2,0.0); SetIndexStyle(3,DRAW_ARROW); SetIndexArrow(3,110); SetIndexBuffer(3,ExtMapBuffer4); SetIndexEmptyValue(3,0.0); IndicatorShortName("Para 2TF ( M"+TF1+" )( M"+TF2+" )"); RefreshRates(); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- ObjectDelete("Para_Label_m1");ObjectDelete("Para_Label_m5"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //---- int limit; int TF[] = {0,0}; TF[0] = TF1; TF[1] = TF2; limit = MathMin(counted_bars,Maxbars); if (limit ==0) limit = Maxbars; for (int ii=0; iiExtMapBuffer3[0]){para_col5=indicator_color1;} if(ExtMapBuffer3[0]>ExtMapBuffer1[0]){para_col5=indicator_color3;} if(ExtMapBuffer2[0]>ExtMapBuffer4[0]){para_col15=indicator_color2;} if(ExtMapBuffer4[0]>ExtMapBuffer2[0]){para_col15=indicator_color4;} ObjectDelete("Para_Label_m5"); if(ObjectFind("Para_Label_m5") != 0) { ObjectCreate("Para_Label_m5", OBJ_TEXT,WindowFind("Para 2TF ( M"+TF1+" )( M"+TF2+" )"), Time[0],indicator_maximum-0.50); ObjectSetText("Para_Label_m5", " M"+TF1+"",7, "Tahoma Narrow",para_col5); } else{ ObjectMove("Para_Label_m5", 0, Time[0],indicator_maximum-0.50); } ObjectDelete("Para_Label_m15"); if(ObjectFind("Para_Label_m15") != 0) { ObjectCreate("Para_Label_m15", OBJ_TEXT,WindowFind("Para 2TF ( M"+TF1+" )( M"+TF2+" )"), Time[0],indicator_maximum-1.50); ObjectSetText("Para_Label_m15", " M"+TF2+"",7, "Tahoma Narrow",para_col15); } else{ ObjectMove("Para_Label_m15", 0, Time[0],indicator_maximum-1.50); } } }